var Socket = (function (io) {

	function Socket(namespace) {
		this.handle = null;
		this.connect(namespace);
	}

	Socket.prototype.connect = function (namespace) {
		var servUrl = conf.server + namespace;
		this.handle = io.connect(servUrl);
	};

	Socket.prototype.sendMessage = function(jo) {
		if(jo) {
			jo.action = 'message';
			this.handle.emit('controller', jo);
		}
	};

	return Socket;
})(io);